﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for ThapTrungBinhKhaCaoCaoRatCaoType
/// </summary>
public class Type_LuaChonMucDo : ICheckAndConvertValues
{

    //Thấp - Trung Bình - Khá Cao - Cao - Rất Cao
    string[] LuaChonMucDo_Symbol ={"O030","O070A","O070B","O080A","O080B","O090A","O090B","O0100A","O0100B","O0110A","O0110B",
                                              "O0120","O0130","O0140","O0160","O0170","O0180","O0190","O0200A","O0200B","O0200A","O0210A","O0210B",
                                              "O0220A","O0220B","O0230A","O0230B","O0240A","O0240B","O0250","O0260","O0270","O0280","O0290","O0300",
                                              "T020A","T020B","T020C",
                                              "T090","T0100","T0110","T0120","T0130","T0140","T0150A","T0160A","T0170A","T0180A","T0190A",
                                              "T0200","T0210","T0220","T0230","T0240","T0250A","T0250B","T0260A","T0260B","T0290",
                                              "M010","M050","M060","M0100","M0110","M0120"};



    string[] LuaChonMucDo_Text = { "Thấp", "Trung Bình", "Khá Cao", "Cao", "Rất Cao" };

    string _value;
    string _columnName;
    public Type_LuaChonMucDo(string _columnName,string _value)
	{
        this._value = _value;
        this._columnName = _columnName;
	}


    public override bool isExistSymbol()
    {
        foreach (string x in LuaChonMucDo_Symbol)
        {
            if (x.ToString().Trim().ToUpper().Equals(_columnName))
                return true;
        }

        return false;
    }

    public override string getText()
    {
        if (_value.Trim().ToUpper().Equals("A"))
        {
            return "Thấp";
        }
        else if (_value.Trim().ToUpper().Equals("B"))
        {
            return "Trung Bình";
        }
        else if (_value.Trim().ToUpper().Equals("C"))
        {
            return "Khá Cao";
        }
        else if (_value.Trim().ToUpper().Equals("D"))
        {
            return "Cao";
        }
        else if (_value.Trim().ToUpper().Equals("E"))
        {
            return "Rất Cao";
        }
        else if (_value.Trim().ToUpper().Equals("F"))
        {
            return "";
        }
        return _value;
            
    }





    public override bool isExistText()
    {
        foreach (string x in LuaChonMucDo_Text)
        {
            if (x.ToString().Trim().ToUpper().Equals(_value.ToString().ToUpper()))
                return true;
        }

        return false;
    }
    public override string getSymbol()
    {
        if (_value.Trim().Equals("Thấp"))
        {
            return "A";
        }
        else if (_value.Trim().Equals("Trung Bình"))
        {
            return "B";
        }
        else if (_value.Trim().Equals("Khá Cao"))
        {
            return "C";
        }
        else if (_value.Trim().Equals("Cao"))
        {
            return "D";
        }
        else if (_value.Trim().Equals("Rất Cao"))
        {
            return "E";
        }
        else if (_value.Trim().Equals(""))
        {
            return "F";
        }
        return _value;
    }
}